-
Notifications
You must be signed in to change notification settings - Fork 6k
[Http Client Latency] Add new page describing the HttpClientLatencyExtension methods #48770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive documentation for the HttpClientLatency extension methods, which provide detailed timing information for HTTP client requests. The documentation covers configuration, usage patterns, and integration with other related services.
- Adds a new documentation page explaining HTTP client latency telemetry features and configuration
- Updates the table of contents to include the new documentation page
- Provides code examples for registration, configuration, and usage of the telemetry features
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
docs/fundamentals/toc.yml | Adds navigation entry for the new HTTP client performance monitoring documentation |
docs/core/extensions/httpclient-latency-extensions.md | Creates comprehensive documentation covering HTTP client latency telemetry configuration, usage, and platform considerations |
…hdanov/latency-tags # Conflicts: # docs/core/extensions/httpclient-latency-extensions.md
// Add HTTP client latency telemetry | ||
builder.Services.AddHttpClientLatencyTelemetry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be highlighted in yellow color?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the "== text ==" syntax? IIRC it won't work in the code block 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a way for it, please let me know what you think of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting HTML is forbidden, so I had to revert it. Not sure whether there's some another way to highlight code inside of the code block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, code blocks should be located in separate *.cs files. That way, it will be possible to highlight lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
### Configure telemetry options | ||
|
||
You configure telemetry collection through the `HttpClientLatencyTelemetryOptions` (standard options pattern). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
standard options pattern
- it should contain a link to the Options pattern documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
### Configure telemetry options | ||
|
||
You configure telemetry collection through the `HttpClientLatencyTelemetryOptions` (standard options pattern). | ||
You can supply values either with a delegate or by binding configuration (for example, appsettings.json). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can supply values either with a delegate or by binding configuration (for example, appsettings.json). | |
You can supply values either with a delegate or by binding configuration (for example, `appsettings.json`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
Measures are numeric values captured during a request that quantify things your timestamp checkpoints alone | ||
don't show - like how long GC pauses stalled the thread or how often a brand-new connection had to be opened instead of | ||
reusing a pooled one. Use them when total latency is higher than the sum of visible phases, when investigating memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use them when total latency is higher than the sum of visible phases, when investigating memory
How can I use them? This information is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
#### Tags | ||
|
||
Use tags to attach stable categorical dimensions to each request so you can segment, filter, and aggregate metrics and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use tags to attach stable categorical dimensions to each request
- how can I do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
## Usage example | ||
|
||
### Track HTTP request client latency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sub-title is not needed, I think. The whole article is dedicated to tracking HTTP request client latency already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
extension enables collection of detailed timing information for outgoing HTTP calls with no changes to calling code. | ||
It plugs into the existing `HttpClientFactory` pipeline to capture stage timings across the request lifecycle, record | ||
HTTP protocol details, measure garbage collection impact where the runtime exposes that data, and emit a uniform | ||
telemetry shape suitable for performance analysis and tuning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs more details.
When this information is collected, what happens next? Does this component produce some logs, metrics, or something else? In other words, what are the output artifacts?
Same questions apply to Measure, Tags, Timing checkpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Summary
This PR adds a new page describing the HttpClientLatency extension methods. This API was long presented in the
dotnet/extensions
, but it was never documented except for the readme in the project itself. The latest changes were merged in dotnet/extensions#6783, so this PR reflects those changes as wellInternal previews